import type { IAddress } from '@/types/address';
import { http } from '@/utils/http';

export const getAddressApi = () => {
  return http<IAddress[]>({
    url: '/mock/address',
    method: 'get',
  });
};

export const postAddressApi = (data: IAddress) => {
  return http({
    url: '/mock/address/add',
    method: 'post',
    data,
  });
};

export const putAddressApi = (data: IAddress) => {
  return http({
    url: '/mock/address/edit',
    method: 'put',
    data,
  });
};

export const delAddressApi = (data: { id: number }) => {
  return http({
    url: '/mock/address/delete',
    method: 'delete',
    data,
  });
};
